﻿using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenCube.IO.Overload;
using OpenCube.Nbt.Mapping;
using OpenCube.Nbt.Specs;
using OpenCube.Specs;

namespace OpenCube.Nbt.Specs
{
	[TestClass]
	public class InjectionSpecs
	{
		[TestMethod]
		public void TestMethod1()
		{
			IInjectionValidationResult validation =
				new InjectionConfigurationValidator()
					.ScanAssemblyContaining<OpenCube.Nbt.InjectionModule>()
					.Scan();

			validation.IsRegistered<INbtMapperFactory>()
				.Should().BeTrue(because: "This interface is injected.");

			validation.IsRegistered<INbtTypeConverter>()
				.Should().BeFalse(because: "this is an interface to be implemented by all typeconverter and applied by attributes. Not Injected.");
			validation.IsRegistered<IConversionContext>()
				.Should().BeFalse(because: "This is an interface that is passed to the converter by method call, not requested by injection");
			validation.IsRegistered<INbtMapper>()
				.Should().BeFalse(because: "This is an interface that is retrieved via the injected factory");

			validation.ShouldHaveNoUnverifiedInterfacesLeft();
		}
	}


}
